package stripepay

import (
	"github.com/gin-gonic/gin"
	"github.com/shopspring/decimal"
	"simplifly-tech/payment/consts"
)

type StripeService struct {
	Channel         consts.SysIncomeChannel `json:"channel"`         //必须 当前支付类型
	SecretKey       string                  `json:"secretKey"`       //api key
	PublicKey       string                  `json:"publicKey"`       //api key
	TransactionRate decimal.Decimal         `json:"transactionRate"` //必须  手续费
	WebhookKey      string                  `json:"webhookKey"`
	Fee             decimal.Decimal
	FeeCurrency     string
}

func (stripeService *StripeService) RefundNotify(ctx *gin.Context) error {
	//TODO implement me
	panic("implement me")
}

func (stripeService *StripeService) Init(
	publicKey, secretKey, webhookKey string,
	transactionRate decimal.Decimal,
	fee decimal.Decimal,
	feeCurrency string) {
	stripeService.Channel = consts.SysIncomeChannelStripe
	stripeService.PublicKey = publicKey
	stripeService.SecretKey = secretKey
	stripeService.WebhookKey = webhookKey
	stripeService.TransactionRate = transactionRate
	stripeService.Fee = fee
	stripeService.FeeCurrency = feeCurrency
}
